def my_middleware(get_response):
    print('init 被调用----之所以会调用两次是因为 DEBUG==True')
    def middleware(request):
        print('before request 被调用....1111111')
        response = get_response(request)
        print('after response 被调用....111111')
        return response
    return middleware


def my_middleware2(get_response):
    print('init 被调用')
    def middleware(request):
        print('request 被调用之前....22222')
        response = get_response(request)
        print('在response被调用之后.....22222')
        return response
    return middleware